<?php
if (!defined('ipos')) die("Please contact Y!m: ichphien_pro or Email: ichphien_pro@yahoo.com.");
if($levelTL != 3) {
	die("Bạn không đủ quyền để truy cập trang này!");
}
// add temp
if($mode == "add") {
	if($_POST['submit'])	{
		$quocgiaten 		 = stripslashes(trim(urldecode($_POST['quocgiaten'])));
		$quocgiaten_kd		 = replace($quocgiaten);
		$quocgiastt 	     = stripslashes(trim(urldecode($_POST['quocgiastt'])));
		if($quocgiaten && $quocgiastt) {
			$db->dbinstall("country","quocgiaten,quocgiaten_kd,quocgiastt","'$quocgiaten','$quocgiaten_kd','$quocgiastt'");
			header("Location: index.php?ipos=country");
		}
	}
	include_once("./code/php/html_country.php");
}
//edit temp
elseif($mode == "edit") {
	$country	=	$db->database("quocgiaten,quocgiastt","country","quocgiaid = '$ipid'");
	if($_POST['submit'])	{
		$quocgiaten 		 = stripslashes(trim(urldecode($_POST['quocgiaten'])));
		$quocgiaten_kd		 = replace($quocgiaten);
		$quocgiastt 	     = stripslashes(trim(urldecode($_POST['quocgiastt'])));
		if($quocgiaten && $quocgiastt) {
			$db->dbupdate("country","quocgiaten = '$quocgiaten',quocgiaten_kd = '$quocgiaten_kd',quocgiastt = '$quocgiastt'","quocgiaid = '$ipid'");
			header("Location: index.php?ipos=country");
		}
	}
	include_once("./code/php/html_country.php");
}
// delete
elseif($mode == "delete") {
	if($ipid) {
		$db->dbdelete("country","quocgiaid = '$ipid'");
		header("Location: index.php?ipos=country");
	}
}
// list temp
else {
	include_once("./code/php/html_country_list.php");
}
?>